<?php
	class news
	{
		var $id;
		var $title;
		var $head;
		var $content;
		var $image;
		var $alias;
		var $status;
	}
	class allnews
	{
		static function Insert($news)
		{
			global $db;
			$sql="INSERT INTO `nv3_vi_news_rows` (`id`, `listcatid`, `topicid`, `admin_id`, `author`, `sourceid`, `addtime`, `edittime`, `status`, `publtime`, `exptime`, `archive`, `title`, `alias`, `hometext`, `homeimgfile`, `homeimgalt`, `homeimgthumb`, `imgposition`, `bodytext`, `copyright`, `inhome`, `allowed_comm`, `allowed_rating`, `ratingdetail`, `allowed_send`, `allowed_print`, `allowed_save`, `hitstotal`, `hitscm`, `hitslm`, `keywords`) VALUES (NULL, '1', '1', '1', 'admin', '0', '".NV_CURRENTTIME."', '0', '".$news->status."', '".NV_CURRENTTIME."', '0', '0', '".$news->title."', '".$news->alias."', '".$news->head."', '".$news->image."', '', '', '1', '".$news->content."', '0', '1', '0', '1', '1', '1', '1', '0', '0', '0', '0', '".$news->title."')";
			$db->sql_query($sql);
		}
		static function GetListcatid($id)
		{
			global $db;
			$sql='select listcaid from nv3_vi_news_rows';
			return $db->sql_query($sql);
		}
		static function DeleteNewsFrom($listcatid,$id)
		{
			global $db;
			foreach($listcatid as $item)
			{
				$sql='delete from nv3_vi_news_'.$item.' where id='.$id;
				$db->sql_query($sql);
			}
		}
		static function Delete($id)
		{
			global $db;
			$sql='delete from nv3_vi_news_rows where id='.$id;
			$db->sql_query($sql);
		}
		
		static function GetByid($id)
		{
			global $db;
			$sql='select * from nv3_vi_news_rows where id='.$id;
			return $db->sql_query($sql);
		}
	}
	class news1
	{
		private $sql;
		private $result;
		private $module_data;
		private $db;
	
		function __construct()
		{
			global $module_data, $db;
	
			$this->module_data = $module_data;
			$this->db = $db;
		}
		function Insert($news)
		{
			$sql="INSERT INTO nv3_vi_news_1 (`id`, `listcatid`, `topicid`, `admin_id`, `author`, `sourceid`, `addtime`, `edittime`, `status`, `publtime`, `exptime`, `archive`, `title`, `alias`, `hometext`, `homeimgfile`, `homeimgalt`, `homeimgthumb`, `imgposition`, `bodytext`, `copyright`, `inhome`, `allowed_comm`, `allowed_rating`, `ratingdetail`, `allowed_send`, `allowed_print`, `allowed_save`, `hitstotal`, `hitscm`, `hitslm`, `keywords`) VALUES (NULL, '1', '1', '1', 'admin', '0', '".NV_CURRENTTIME."', '0', '".$news->status."', '".NV_CURRENTTIME."', '0', '0', '".$news->title."', '".$news->alias."', '".$news->head."', '".$news->image."', '', '', '1', '".$news->content."', '0', '1', '0', '1', '1', '1', '1', '0', '0', '0', '0', '".$news->title."')";
			$this->db->sql_query($sql);
		}
	}
	class Get
	{
		static function Insert($id)
		{
			global $db;
			$sql='INSERT INTO getnews values('.$id.')';
			$db->sql_query($sql);
		}
		static function GetByAll()
		{
			global $db;
			$sql='select * from getnews';
			return $db->sql_query($sql);
		}
		static function Delete($id)
		{
			global $db;
			$sql='delete from getnews where id='.$id;
			$db->sql_query($sql);
		}
	}
?>